import * as API from "@/utils/axios";

export const paramType ={
    'connect':'/stream/connect/',// 获取视频监控地址
    'keepLive':'/stream/keepLive/',// 视频保活
    'getLEDInfo':'/visualization/device/getLEDInfo',// 获取LED设备数据
    'setupDeviceInfo':'/visualization/device/setupDeviceInfo',// 保存设备设置数据
    'resetScale':'/visualization/scale/reset',// 重置皮带秤数据
}
/******************      通用增删改查       ********************* */

/**
 * 通用GET
 * @param {*} param
 */
export const GET = (key,param)=> {
    return API.GET(paramType[key], param)
}

/**
 * 通用GET
 */
export const GET_RESTFUL =  (key,param)=> {
    return API.GET(paramType[key]+'/'+param,{})
}
/**
 * 通用POST
 * @param {*} param
 */
export const POST =  (key,param)=> {
    return API.POST(paramType[key], param)
}

export const PUT = (key,param) =>{
    return API.PUT(paramType[key], param)
}

export const DELETE = (key,param) =>{
    return API.DELETE(paramType[key], param)
}
// 通用接口集合
export const currentApi= {
    GET,
    GET_RESTFUL,
    POST,
    PUT,
    DELETE,
}